//
//  Settings.h
//  A One POS
//
//  Created by AonePOS on 24/09/13.
//  Copyright (c) 2013 AonePOS. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "TotalServerSynClass.h"
#import "PrinterCell.h"
#import "TaxesCell.h"
#import "PaymentCell.h"

@interface Settings : UIViewController<UITextFieldDelegate,UITableViewDataSource,UITableViewDelegate,UIAlertViewDelegate,UIImagePickerControllerDelegate,UINavigationControllerDelegate,NSURLConnectionDataDelegate>
{
   
    UIView *sidemenu,*mainview,*backgroundcolorview;
    UIButton *categorybutton;
    UIToolbar *downtoolBar,*maintoolBar;
    UIImageView *logobackview,*logoimageview;
    int y,p;
    _Bool isLandScope;
    UIButton *helpiconButton,*logouticonButton,*menubutton;
    BOOL menuslected;
    UIButton *Applicationbarbtn,*Printerbarbtn,*taxbarbtn,*paymentbarbtn,*DBbarbtn,*dataresetbarbtn,*CompanyBtn,*CardBtn;
    UINavigationBar *navBar;
    UIScrollView *scrollView;
    UIView *ApplicationView,*TaxView,*AddTaxView,*paymentview,*AddpaymentView;
  
    UITextField *nameTextfield,*RateTextfield,*changetaxField,*changerateField,*paymentnameField;
    UILabel *namelabel,*RateLabel,*paymentnamelbl,*paymenttaxlbl,*disablepaymentlbl,*enablepaymentlbl;
     UILabel *taxnamelbl,*ratetaxlbl;
    UIButton *SaveTaxButton,*CancelTaxButton,*changesavetax,*changecanceltax,*savepaymentBtn,*cancelpaymentBtn,*paymentenableradioBtn,*paymentdisableradioBtn,*addpaymentBtn,*editpaymentBtn;
    UITableView *edittaxTable,*PaymentTable;
    UIAlertView *deletetaxAlert,*deletePaymentAlert;
    NSInteger selectedTax,selectedPayment;
    UIButton *editBtn,*viewbtn;
    UITextView *namelbl, *taxlbl;
    UIButton *addtaxBtn,*editTaxButton;
    UIView *edittaxpopup,*editPaymentPopup;
    NSString *name,*taxrate;
    UIButton *deletepaymentBtn,*editPaymentBtn;
    NSString *payNameStr,*payValueStr;
    
    UIScrollView *EdittaxBackView;
    
    
    //paypopup view
    UILabel *paynameLbl,*payValuelbl,*enablePaylbl,*disablePaylbl;
    UITextField *payNametext;
    UIButton *payEnableBtn,*payDisableBtn,*CancelpayBtn,*SaveChangePayBtn;
    
    //reset db view
    
    UIView *dataresetView,*Resetview;
    UILabel *Titlelbl,*resetAllLbl,*ProductsLbl,*selllLbl,*customerlbl,*textLabel,*yeslbl,*Nolbl;
    UIButton *resetAllBtn,*ProductsBtn,*SellBtn,*CustomerBtn,*resetButton,*setYesBtn,*setNoBtn;
    UIAlertView *resetdataAlert;
    //printer view
    UIView *printerview;
   UIScrollView *addprinterdataView;
    NSString *columnnamestr,*feedstr,*spacingstr,*columnsizeStr;
    UILabel *textlbl,*fieldslbl;
    UITextField *dataField,*printernameField,*printeridField;
    UIButton *updateButton,*getprinterstatusBtn;
    UITableView *aligndataTable,*fontsTable,*printermethodsTable;
    NSArray *aligndataArray,*fontsizesArray,*printmethodsArray;
    UIButton *alignButton,*fontsizeBtn,*printermethodBtn;
    //DB Bacup view
    UIView *DbbackUpview,*addDBBackupView;
    UIButton *ServerSynBtn,*UploadXlsBtn,*ExportDatabaseBtn,*ImportDatabaseBtn;
    
    
    
    UIAlertView *SynAlertview;
    
    //Applicatiopn View;
    UIView *addApplicationDataView;
    UILabel *AppTextLbl;
    UIButton *DeptBtn,*ItemsBtn;
    UITableView *DepartmentsTable,*ItemsTable;
    UIButton *SaveTsBtn,*CancelTsBtn,*DeptCheckBox,*ItemCheckBox;
    NSMutableArray *DepartmentsArray,*ItemsArray;
    
    UIButton *saveDeptsBtn,*SaveItemsBtn;
    
    //Company View
    UIView *CompanyBackView;
    UIScrollView *CompanyView;
    UIButton *HomeImageBtn;
    UIImageView *HomeImageView;
     UIImagePickerController *imgpicker;
    UIImage *selectedimage;
    
    NSMutableArray *deptSArray;
    
    NSMutableArray *ChecksArray,*ItemChecksArray;
    
//Divya Printer View
    
    //Divya
    UIButton * addPrintButton,*editPrinterButton;
    UILabel * printCharLabel, * fontLabel, * alignLineSpaLabel, * langLabel, *sizeLabel, * styleLabel,* underLineLabel, *xPositionLabel, * feedUnitLabel, * PrinterNameLabel, * printerIDLabel, * ipAddressLabel, * boldLabel,*LignSpacelbl,*PrinterTypeLabel;
    
    UITextView * printerCharTF;
    
    UITextField * alignLineSpaTF, * langTF, *xPositionTF, * feedUnitTF, * printeridTF, * ipAddressTF;
    
    NSArray * fontArray, * alignLineSpacArray, * langArray, * sizeWidthArray, * sizeheightArray, * printerNameArray;
    
    UITableView * fontTableView, * alignLineSpaTV, * languageTV, *sizeWidthTV, * sizeHeightTV, *printerNameTV;
    
    UIButton * fontButton, * alignLineSpaButton,* languageButton,* sizeButton,* widthButton,* printerNameButton, * saveButton,*PrinterTypeBtn;
    
    UISwitch * boldSwitch,* underlineSwitch;
    UITableView *editPrinterTable,*PrinterTypesTable;
    
     NSString *Bold,*Underline;
    
    NSMutableArray *printcharArray,*FontsArray,*AlignsArray,*languagesArray,*WidthsArray,*HeightsArray,*boldsArray,*UnderlinesArray,*XpossArray,*unitsArray,*spacingsArray,*printernamesArray,*IpAddsArray,*PrinterIdsArray,*PrintertypesArray;
    
    UIAlertView *PrinterAlert;
    NSInteger SelectedPrinter;
    UILabel *Printer1Label;
    
//Edit printer View
    
    UIView *EditPrinterPopUpView;
    UIScrollView *EditPrinterView;
    
    UILabel *EditprintCharLabel, *EditfontLabel, *EditalignLineSpaLabel, *EditlangLabel, *EditsizeLabel, *EditstyleLabel,*EditunderLineLabel, *EditxPositionLabel, *EditfeedUnitLabel, * EditPrinterNameLabel, * EditprinterIDLabel, * EditipAddressLabel, * EditboldLabel,*EditLignSpacelbl,*EditPrintertypelabel;
    
    UITextView * EditprinterCharTF;
    
    UITextField * EditalignLineSpaTF, * EditlangTF, *EditxPositionTF, * EditfeedUnitTF, * EditprinteridTF, * EditipAddressTF;
    UITableView * EditfontTableView, * EditalignLineSpaTV, * EditlanguageTV, *EditsizeWidthTV, * EditsizeHeightTV, *EditprinterNameTV,*EditPrinterTypesTable;
    
    UIButton * EditfontButton, * EditalignLineSpaButton,* EditlanguageButton,* EditsizeButton,* EditwidthButton,* EditprinterNameButton, *EditsaveButton,*EditPrinterTypeBtn;
    
    UISwitch * EditboldSwitch,* EditunderlineSwitch;
    
    NSString *PrinterName;
    
    NSMutableArray *DbPrinterTypesArray;
    
//Server url View
    
    UIView *ServerUrlBackView,*ServerView;
    
    UILabel *ServerUrllbl;
    UITextField *ServerTextView;
    UIButton *SaveServerUrlBtn;
    
    UIAlertView *ServerUrlAlert;
    
    
//Card View
    
    UIView *CardBackView;
    UIScrollView *CardView;
    UILabel *primaryurllbl,*Securllbl,*merchantNolbl,*terminalNolbl,*Processdebittextlbl,*requiretextlbl,*timeoutlbl;
    UITextField *PrimaryField,*SecondaryField,*MerchantField,*TerminalField,*timeoutTextField;
    UIButton *saveCardDataBtn,*ProcessBtn,*RequireBtn;
    
    
    
    NSURLConnection *connection1;
    NSMutableString *ServerurlStr;
    
     UILabel *sationLbl,*Timelbl,*EmpIdlbl;
    UIButton *logoBtn;
    
    
    UITextField *CompanyTextF;
    UIButton *SubmitCmpyBtn;
    
    
    NSURLConnection *RegisterConnection;
    NSMutableData *RegisterResponseData;
    
    UIAlertView *SavecompanyAlert;
    
    //changes in card data
    
    UILabel *paymentLabel;
    
    UIButton * paymentButton;
    
    UITableView * paymentTableView;
    
    NSArray * paymentArray;
    NSString * paymentStr;
    
    NSURLConnection *InvConnection,*DeptConnection;
    NSMutableData *InvResponseData,*DeptResponseData;
    NSMutableArray *EdittaxArray;
    IBOutlet PrinterCell *printerCell;
    IBOutlet TaxesCell *taxesCell;
    IBOutlet PaymentCell *paymentCell;
    
    UILabel *wifiLabel,*btLabel;
    UISwitch *wifi_Switch;
    
    UILabel *editwifiLabel,*editbtLabel;
    UISwitch *editwifi_Switch;
    NSString *SearchPrinterStr;
    NSMutableArray *searchPrinterArray;
    NSMutableDictionary  *dataDict;
    NSString *myurlstring;
    
    //merchant View
    
    
}
-(void)releaseViews;
- (IBAction)printer_editButtonClicked:(id)sender;
- (IBAction)printer_deleteButtonClicked:(id)sender;

- (IBAction)tax_editButtonClicked:(id)sender;
- (IBAction)tax_deleteButtonClicked:(id)sender;

- (IBAction)payment_editButtonClicked:(id)sender;
- (IBAction)payment_deleteButtonClicked:(id)sender;
@end
